﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Xpom_Xpum__Code_Generator.Utilities
{
    public class StringParser
    {
        public static String[] QuoteSplit(string str)
        {
            List<String> result = new List<String>();

            string curString = "";

            for (int i = 0; i < str.Length; i++)
            {
                char c = str[i];

                if (c == '"')
                {
                    var trimmed = curString.Trim();
                    if (trimmed.Length > 0)
                    {
                        result.Add(trimmed);
                    }
                    curString = "";
                    continue;
                }

                curString += c;
            }

            return result.ToArray();
        }
    }
}
